<?php
//---------------------------------------------------------------------------------------------------
    require_once('../config.inc.php');

    require_once($config['app_dir'] . '/classes/forecasts.deamon.php');
    //-----------------------------------------------------------------------------------------------
    //$LastForecastDeamon = new objLastForecastDeamon();
    //$LastForecastDeamon->Render();


    $DashboardForecasts = new objDashboardForecastsShow();
    foreach($DashboardForecasts->GetData() as $aForecast) {

        $forecast_id = $aForecast['ForecastID'];
/*

        $trade = $aForecast['TradeID'];
        $system = $aForecast['SystemID'];

       //if( $aForecast['ChartPeriod'] < 60*60*24*16 )$aForecast['ChartPeriod'] = 60*60*24*16;

        $start = $aForecast['BeginForecast'];//-$aForecast['ChartPeriod']+$aForecast['TimeFrame'];
        $finish = $aForecast['EndForecast'];//+$aForecast['TimeFrame'];
        $times = round($aForecast['ViewPeriod']/$aForecast['ChartPeriod']);

        echo "ForecastID: $forecast_id, Trade: $trade, System: $system [$start - $finish] \n";

        $td = $finish; $cc=0;
        while( $cc<$times ) {
            if( DateConvert::isWeekendDay($td) ) $start  -= $aForecast['TimeFrame'];
            else $cc++;
            $td  -= $aForecast['TimeFrame'];
        }//while
        echo "ForecastID: $forecast_id, Trade: $trade, System: $system [$start - $finish] \n";
        echo"========================================\n";
*/
        $ForecastItem = new objDashboardForecastItem($forecast_id);
        /*
        $ForecastItem->start = $start;
        $ForecastItem->finish = $finish;
        $ForecastItem->pair = $trade;
        */
        $ForecastItem->Render();

    } //foreach

//---------------------------------------------------------------------------------------------------
?>
